import request from '@/utils/request'

// 获取订单列表
export function getOrderList(params) {
    return request({
        url: '/api/admin/orders/list',
        method: 'post',
        data: params
    })
}

// 获取订单详情
export function getOrderDetail(id) {
    return request({
        url: `/api/admin/orders/info/${id}`,
        method: 'get'
    })
}

// 更新订单状态
export function updateOrderStatus(data) {
    return request({
        url: '/api/orders/status',
        method: 'put',
        data
    })
}

// 删除订单
export function deleteOrder(ids) {
    return request({
        url: '/api/orders',
        method: 'delete',
        data: { ids }
    })
}

// 批量操作订单
export function batchOperation(data) {
    return request({
        url: '/api/orders/batch',
        method: 'put',
        data
    })
}   